package cn.wolfcode.p2p.business.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import cn.wolfcode.p2p.business.domain.CreditTransfer;
import cn.wolfcode.p2p.business.query.CreditTransferQueryObject;

public interface CreditTransferMapper {

	/**
	 * 查询指定用户可转让的而债权列表
	 * 
	 * @param id
	 * @return
	 */
	List<CreditTransfer> listCanTransferCredit(Long id);

	int insert(CreditTransfer record);

	CreditTransfer selectByPrimaryKey(Long id);

	int updateByPrimaryKey(CreditTransfer record);

	/**
	 * 将选中准备转让的bidid查询出对应的债权转让对象
	 * 
	 * @param id
	 * @param bidId
	 * @return
	 */
	List<CreditTransfer> listReadyToTransferCredit(@Param("userId") Long id, @Param("bidIds") Long[] bidId);

	void changePaymentScheduleDetailTransState(@Param("bidId") Long bidId, @Param("state") int inTrans);

	List<CreditTransfer> queryData(CreditTransferQueryObject qo);

	void changePaymentScheduleDetailInvestor(@Param("bidId") Long bidId, @Param("investorId") Long id);

	/**
	 * 查询bidid对应的正在招标中的债权标
	 * 
	 * @param bidId
	 * @return
	 */
	CreditTransfer findNeedCancel(Long bidId);

}
